package lichao.mapper;


import lichao.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user")
    List<User> getAll();

    @Insert({"insert into user(name) values(#{name})"})
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void addUser(User user);


    @Insert({"insert into tb_user(username,password) values(#{username},#{password})"})
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void addtbUser(@Param("username") String username, @Param("password") String password);
}
